﻿//
// XN4SL - Xna Framework for Silverlight.
//
using Xn4Sl.Framework;
using System;

namespace Xn4Sl.Framework.Input
{
    /// <summary>
    /// Represents specific information about the state of an Xbox 360 Controller,
    /// including the current state of buttons and sticks
    /// </summary>
    public struct GamePadState
    {
        private GamePadThumbSticks thumbSticks;
        private GamePadTriggers triggers;
        private GamePadButtons buttons;
        private GamePadDPad dPad;

        /// <summary>
        /// Initializes a new instance of the GamePadState class using the specified
        /// GamePadThumbSticks, GamePadTriggers, GamePadButtons, and GamePadDPad.
        /// </summary>
        /// <param name="thumbSticks">Initial thumbstick state.</param>
        /// <param name="triggers">Initial trigger state.</param>
        /// <param name="buttons">Initial button state.</param>
        /// <param name="dPad">Initial directional pad state.</param>
        public GamePadState(GamePadThumbSticks thumbSticks, GamePadTriggers triggers, GamePadButtons buttons, GamePadDPad dPad)
        {
            this.thumbSticks = thumbSticks;
            this.triggers = triggers;
            this.buttons = buttons;
            this.dPad = dPad;
        }

        /// <summary>
        /// Returns a structure that identifies what buttons on the Xbox 360 controller
        /// are pressed. 
        /// </summary>
        public GamePadButtons Buttons
        {
            get
            {
                return new GamePadButtons();
            }
        }

        /// <summary>
        /// Returns a structure that identifies what directions of the directional pad
        /// on the Xbox 360 Controller are pressed.
        /// </summary>
        public GamePadDPad DPad
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        /// <summary>
        /// Indicates whether the Xbox 360 Controller is connected.
        /// </summary>
        public bool IsConnected
        {
            get
            {
                return false;
            }
        }

        /// <summary>
        /// Gets the packet number associated with this state.
        /// </summary>
        public int PacketNumber
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        /// <summary>
        /// Returns a structure that indicates the position of the Xbox 360 Controller
        /// sticks (thumbsticks).
        /// </summary>
        public GamePadThumbSticks ThumbSticks
        {
            get
            {
                return new GamePadThumbSticks(new Vector2(), new Vector2());
            }
        }

        /// <summary>
        /// Returns a structure that identifies the position of triggers on the Xbox
        /// 360 controller.
        /// </summary>
        public GamePadTriggers Triggers
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        /// <summary>
        /// Determines whether specified input device buttons are pressed in this GamePadState.
        /// </summary>
        /// <param name="button">Buttons to query. Specify a single button, or combine multiple 
        /// buttons using a bitwise OR operation.</param>
        /// <returns>true if all specified buttons are pressed; false otherwise.</returns>
        public bool IsButtonDown(Buttons button)
        {
            return false;
        }

        /// <summary>
        /// Determines whether specified input device buttons are up (not pressed) in
        /// this GamePadState.
        /// </summary>
        /// <param name="button">Buttons to query. Specify a single button, or combine 
        /// multiple buttons using a bitwise OR operation.</param>
        /// <returns>true if any specified buttons are up; false otherwise.</returns>
        public bool IsButtonUp(Buttons button)
        {
            return true;
        }
    }
}
